using System;
using System.Collections.Generic;
using System.Xml.Serialization;

/// <summary>
/// This class represents a combo-attack
/// </summary>
[Serializable()]
public class ComboDefine
{
    #region Public Fields
    public List<InputKey> Combokeys;
    public string Description;
    #endregion

    public static string DEFINE_FILE = "ComboDefines.bwx";

    public ComboDefine()
    {
        Combokeys = new List<InputKey>();
    }

    /// <summary>
    /// Shows the needed keys for debug purposes
    /// </summary>
    override public string ToString()
    {
        string ret = Description + ": ";

        foreach (InputKey ik in Combokeys)
        {
            ret += ik.ToString() + " ";
        }

        return ret;
    }

    public void AddNewComboKey(InputKey key)
    {
        Combokeys.Add(key);
    }

}

[Serializable]
public class ComboDefineList
{
    public List<ComboDefine> Items;

    public ComboDefineList()
    {
        Items = new List<ComboDefine>();
    }

    public void AddNew(string Description, InputKey[] ComboKeys)
    {
        ComboDefine cf = new ComboDefine();
        cf.Description = Description;
        cf.Combokeys.AddRange(ComboKeys);
        Items.Add(cf);
    }

    public void AddNew(string Description)
    {
        ComboDefine cf = new ComboDefine();
        cf.Description = Description;
        Items.Add(cf);
    }

    public string[] ToStringArray()
    {
        string[] ret = new string[Items.Count];

        for (int i = 0; i < Items.Count; ++i)
        {
            ret[i] = Items[i].Description;
        }

        return ret;
    }

}